package com.example.data0303;

import android.os.Bundle;
import android.util.Log;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;

import com.example.data0303.adapter.DemoFragment;

public class FragmentActivity extends AppCompatActivity {

    private DemoFragment topFragment;
    private DemoFragment bottomFragment;
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_fragment);
        Log.e("tag","消息");

        topFragment=new DemoFragment();
        bottomFragment=new DemoFragment();



        getFragmentManager()
                .beginTransaction()
                .replace(R.id.ll_top_fl,topFragment)
                .commit();

        getFragmentManager()
                .beginTransaction()
                .replace(R.id.bottom_top_fl,bottomFragment)
                .commit();
    }

    @Override
    protected void onStart() {
        super.onStart();
        Log.e("tag","onStart");
    }

    @Override
    protected void onRestart() {
        super.onRestart();
        Log.e("tag","onRestart");
    }

    @Override
    protected void onResume() {
        super.onResume();
        Log.e("tag","onResume");
    }

    @Override
    protected void onPause() {
        super.onPause();
        Log.e("tag","onPause");
    }

    @Override
    protected void onStop() {
        super.onStop();
        Log.e("tag","onStop");
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        Log.e("tag","onDestroy");
    }
}
